#include<stdio.h>
#include<sstream>
#include<iostream>
#include<fstream>
#include<time.h>

//file formats
#define EMPTY 0
#define TMP 1
#define ORIGIN_CSV 2
#define OUT_CSV 3
#define TEST_CSV 4

//logger' types
#define LOG_ERROR 100
#define LOG_WARN 50
#define LOG_INF 1
#define max_bsize 100

class Logger{
protected: 
	static Logger *self;
	static int refcount;
	Logger();
	~Logger();
public:
	static Logger *Instance(){
		++refcount;
		if(!self) {
			self = new Logger();
		}
		return self;
	}
	void Free(){
		--refcount;
		if(refcount == 0){
			delete this;
			self = NULL;
		}
	}
	std::ofstream out;
	int level;
	std::string buff;
	void send(int, std::string);
	void sendERROR(int _last_error, std::string _message);
	void sendINF(char *file_name, __int64 file_size, int FILE_FORMAT);
	void sendINF(char *file_name, std::string message);
};